package com.woniu.message.listener;

import com.woniu.api.order.OrderClient;
import com.woniu.common.entity.dto.PaymentNotification;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Listener {

    @Autowired
    private OrderClient orderClient;

    @RabbitListener(queues = "paymentQueue")
    public void handlePaymentNotification(PaymentNotification notification) {
        orderClient.updateOrderStatus(notification);
    }
}
